package com.bytz.modules.cms.echop.sync;

import com.bytz.modules.cms.echop.model.*;
import feign.Response;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(
        name = "e-chop-api",
        url = "${e-chop-api.base-url}",
        configuration = EChopInterceptor.class
)
public interface EChopFeign {

    @ApiOperation("1.1.1.1-根据文件类型创建合同文档")
    @RequestMapping(value = "/v2/document/createbyfile", method = RequestMethod.POST, consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    CreateDocumentByFileResult createDocumentByFile(CreateDocumentByFileRequest request);

    @ApiOperation("1.1.1.2-用模板创建合同文档")
    @RequestMapping(value = "/document/createbytemplate", method = RequestMethod.POST, consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    CreateDocumentByTemplateResult createDocumentByTemplate(CreateDocumentByTemplateRequest request);

    @ApiOperation("1.1.4.1-创建合同")
    @RequestMapping(value = "/contract/createbycategory", method = RequestMethod.POST)
    CreateContractResult createContractByCategory(@RequestBody CreateContractRequest request);

    @ApiOperation("1.4.1.1-合同详情")
    @RequestMapping(value = "/contract/detail", method = RequestMethod.POST, consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    Response contractDetail();

    @ApiOperation("1.4.2.2-下载合同文档")
    @RequestMapping(value = "/document/download", method = RequestMethod.GET)
    Response downloadContract(@RequestParam("documentId") String documentId);
}
